﻿package com.msjt.service.impl;

import java.util.List;

import javax.annotation.Resource;

import com.msjt.dao.UsersDAO;
import com.msjt.entity.Users;
import com.msjt.service.IUsersService;

/**
 * name:UsersService
 * function:用户管理的业务逻辑层
 * author: kw
 * time:2013.8.28
 * updateTime:
 */
public class UsersService implements IUsersService {
	@Resource
	private UsersDAO usersDao;

	public UsersDAO getUsersDao() {
		return usersDao;
	}

	public void setUsersDao(UsersDAO usersDao) {
		this.usersDao = usersDao;
	}
	//用户登录
	/* (non-Javadoc)
	 * @see com.msjt.service.impl.IUsersService#queryLogin(com.msjt.entity.Users)
	 */
	public Users queryLogin(Users users){
		return this.usersDao.login(users);
	}
	//根据ID得到用户信息
	/* (non-Javadoc)
	 * @see com.msjt.service.impl.IUsersService#getUsersById(com.msjt.entity.Users)
	 */
	public Users getUsersById(Users users){
		return this.usersDao.getUsersInfo(users);
	}
	//得到所有用户信息分页显示
	/* (non-Javadoc)
	 * @see com.msjt.service.impl.IUsersService#getUsersPage(int, int)
	 */
	public List<Users> getUsersPage(int pageIndex,int pageSize){
		return this.usersDao.getUsersPage(pageIndex, pageSize);
	}
	//用户信息修改
	/* (non-Javadoc)
	 * @see com.msjt.service.impl.IUsersService#updateUsers(com.msjt.entity.Users)
	 */
	public boolean updateUsers(Users users){
		return this.usersDao.updateUserInfo(users);
	}
	//添加OA管理用户
	/* (non-Javadoc)
	 * @see com.msjt.service.impl.IUsersService#addUsers(com.msjt.entity.Users)
	 */
	public boolean addUsers(Users users){
		return this.usersDao.addUsers(users);
	}
	//删除用户
	/* (non-Javadoc)
	 * @see com.msjt.service.impl.IUsersService#deleteUsers(com.msjt.entity.Users)
	 */
	public boolean deleteUsers(Users users){
		return this.usersDao.deleteUsers(users);
	}

	public Integer getUsersCount() {
		return this.usersDao.getUsersCount();
	}

	public boolean updatePwd(Users users) {
		return this.usersDao.updatePwd(users);
	}

	public boolean findUsersName(Users users) {
		return this.usersDao.findUsersName(users);
	}

	public List<Users> selectUserLike(Users user, int pageIndex, int pageSize) {
		return this.usersDao.selectUsersLike(user, pageIndex, pageSize);
	}

	public Integer getUsersCount(Users users) {
		return this.usersDao.getUsersCount(users);
	}

	public boolean deleteMore(String idString) {
		return this.usersDao.deleteMoreUsers(idString);
	}
}
